//
//  SmallDecisionsFxqButton.h
//  SmallDecisions
//
//  Created by 李付雄 on 2025/08/28.
//

#import "SmallDecisionsFxqButton.h"
#import <AudioToolbox/AudioToolbox.h>

@implementation SmallDecisionsFxqButton

+ (instancetype)buttonWithType:(UIButtonType)buttonType {
    SmallDecisionsFxqButton *fxqButton = [super buttonWithType:buttonType];
    [fxqButton addTarget:fxqButton action:@selector(tapControlEventTouchUpInsideAction) forControlEvents:UIControlEventTouchUpInside];
    [fxqButton addTarget:fxqButton action:@selector(tapControlEventTouchDownAction) forControlEvents:UIControlEventTouchDown];
    return fxqButton;
}

- (void)tapControlEventTouchUpInsideAction {
    [UIView animateWithDuration:0.1 animations:^{
        self.transform = CGAffineTransformMakeScale(1.0, 1.0);
    }];
}

- (void)tapControlEventTouchDownAction {
    AudioServicesPlaySystemSound(1520);
    [UIView animateWithDuration:0.1 animations:^{
        self.transform = CGAffineTransformMakeScale(0.8, 0.8);
    }];
}

@end
